<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">YAML</span><span class="PUNC">=</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">errors</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">reference_blocks</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">processing_time</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">regex</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="NAME">regLevel</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^([\\s\\-]+)"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">invalidLine</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">dashesString</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">'^\\s*\\"([^\\"]*)\\"\\s*$'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">quotesString</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^\\s*\\'([^\\']*)\\'\\s*$"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="STRN">"float"</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">integer</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^[+-]?[0-9]+$"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">array</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"\\[\\s*(.*)\\s*\\]"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">map</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"\\{\\s*(.*)\\s*\\}"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">key_value</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"([a-z0-9_-][ a-z0-9_-]*):( .+)"</span><span class="PUNC">,</span><span class="STRN">"i"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">single_key_value</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^([a-z0-9_-][ a-z0-9_-]*):( .+?)$"</span><span class="PUNC">,</span><span class="STRN">"i"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">key</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"([a-z0-9_-][ a-z0-9_-]+):( .+)?"</span><span class="PUNC">,</span><span class="STRN">"i"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">item</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^-\\s+"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">trim</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"^\\s+|\\s+$"</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="NAME">comment</span><span class="PUNC">:</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="STRN">"([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?"</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">Block</span><span class="PUNC">(</span><span class="NAME">lvl</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="PUNC">{</span><span class="NAME">parent</span><span class="PUNC">:</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="NAME">length</span><span class="PUNC">:</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">level</span><span class="PUNC">:</span><span class="NAME">lvl</span><span class="PUNC">,</span><span class="NAME">lines</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">children</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NAME">addChild</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">this.children.push</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">obj.parent</span><span class="PUNC">=</span><span class="KEYW">this</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">this.length</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">createXMLHTTPRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xmlhttp</span><span class="PUNC">;</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="NAME">xmlhttp</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">XMLHTTP_IDS</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="STRN">"MSXML2.XMLHTTP.5.0"</span><span class="PUNC">,</span><span class="STRN">"MSXML2.XMLHTTP.4.0"</span><span class="PUNC">,</span><span class="STRN">"MSXML2.XMLHTTP.3.0"</span><span class="PUNC">,</span><span class="STRN">"MSXML2.XMLHTTP"</span><span class="PUNC">,</span><span class="STRN">"Microsoft.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">XMLHTTP_IDS.length</span><span class="PUNC">&&</span><span class="PUNC">!</span><span class="NAME">success</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">try</span><span class="PUNC">{</span><span class="NAME">xmlhttp</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="NAME">XMLHTTP_IDS</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">success</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">}</span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">success</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"Unable to create XMLHttpRequest."</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">xmlhttp</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">fromURL</span><span class="PUNC">(</span><span class="NAME">src</span><span class="PUNC">,</span><span class="NAME">ondone</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">client</span><span class="PUNC">=</span><span class="NAME">createXMLHTTPRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">client.onreadystatechange</span><span class="PUNC">=</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this.readyState</span><span class="PUNC">==</span><span class="NUMB">4</span><span class="PUNC">||</span><span class="NAME">this.status</span><span class="PUNC">==</span><span class="NUMB">200</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">txt</span><span class="PUNC">=</span><span class="NAME">this.responseText</span><span class="PUNC">;</span><span class="NAME">ondone</span><span class="PUNC">(</span><span class="NAME">YAML.eval</span><span class="PUNC">(</span><span class="NAME">txt</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="NAME">client.open</span><span class="PUNC">(</span><span class="STRN">"GET"</span><span class="PUNC">,</span><span class="NAME">src</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">client.send</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">parser</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">regLevel</span><span class="PUNC">=</span><span class="NAME">regex.regLevel</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">invalidLine</span><span class="PUNC">=</span><span class="NAME">regex.invalidLine</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">=</span><span class="NAME">str.split</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">level</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">curLevel</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">blocks</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Block</span><span class="PUNC">(</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentBlock</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Block</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">result.addChild</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">levels</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">=</span><span class="STRN">""</span><span class="PUNC">;</span><span class="NAME">blocks.push</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">levels.push</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">lines.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">line</span><span class="PUNC">=</span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">line.match</span><span class="PUNC">(</span><span class="NAME">invalidLine</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">regLevel.exec</span><span class="PUNC">(</span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">level</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">level</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">></span><span class="NAME">curLevel</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldBlock</span><span class="PUNC">=</span><span class="NAME">currentBlock</span><span class="PUNC">;</span><span class="NAME">currentBlock</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Block</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">oldBlock.addChild</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">blocks.push</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">levels.push</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">&lt;</span><span class="NAME">curLevel</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">added</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">=</span><span class="NAME">levels.length</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="PUNC">;</span><span class="NAME">k</span><span class="PUNC">>=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="PUNC">--</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">levels</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentBlock</span><span class="PUNC">=</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Block</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">blocks.push</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">levels.push</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">parent</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">parent.addChild</span><span class="PUNC">(</span><span class="NAME">currentBlock</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="NAME">added</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="KEYW">break</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">added</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">errors.push</span><span class="PUNC">(</span><span class="STRN">"Error: Invalid indentation at line "</span><span class="PUNC">+</span><span class="NAME">i</span><span class="PUNC">+</span><span class="STRN">": "</span><span class="PUNC">+</span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">return</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="NAME">currentBlock.lines.push</span><span class="PUNC">(</span><span class="NAME">line.replace</span><span class="PUNC">(</span><span class="NAME">regex.trim</span><span class="PUNC">,</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">curLevel</span><span class="PUNC">=</span><span class="NAME">level</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">val</span><span class="PUNC">=</span><span class="NAME">val.replace</span><span class="PUNC">(</span><span class="NAME">regex.trim</span><span class="PUNC">,</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">"true"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">"false"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">".NaN"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Number.NaN</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">"null"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">".inf"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Number.POSITIVE_INFINITY</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">==</span><span class="STRN">"-.inf"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Number.NEGATIVE_INFINITY</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.dashesString</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.quotesString</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex</span><span class="PUNC">[</span><span class="STRN">"float"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.integer</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">Date.parse</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.single_key_value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.array</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">c</span><span class="PUNC">=</span><span class="STRN">" "</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">content</span><span class="PUNC">=</span><span class="STRN">""</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">lenJ</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">lenJ</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">c</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">&&</span><span class="NAME">str</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">||</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">&&</span><span class="NAME">str</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"["</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"{"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">++</span><span class="NAME">count</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"]"</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"}"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">--</span><span class="NAME">count</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="NAME">count</span><span class="PUNC">==</span><span class="NUMB">0</span><span class="PUNC">&&</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">","</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">content</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">=</span><span class="STRN">""</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">content.length</span><span class="PUNC">></span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">content</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">val.match</span><span class="PUNC">(</span><span class="NAME">regex.map</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">c</span><span class="PUNC">=</span><span class="STRN">" "</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">content</span><span class="PUNC">=</span><span class="STRN">""</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">lenJ</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">lenJ</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">c</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">&&</span><span class="NAME">str</span><span class="PUNC">==</span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">||</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">&&</span><span class="NAME">str</span><span class="PUNC">==</span><span class="STRN">'"'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"["</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"{"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">++</span><span class="NAME">count</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"]"</span><span class="PUNC">||</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">"}"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">--</span><span class="NAME">count</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">===</span><span class="KEYW">false</span><span class="PUNC">&&</span><span class="NAME">count</span><span class="PUNC">==</span><span class="NUMB">0</span><span class="PUNC">&&</span><span class="NAME">c</span><span class="PUNC">==</span><span class="STRN">","</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">content</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">content</span><span class="PUNC">=</span><span class="STRN">""</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="NAME">content</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">c</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">content.length</span><span class="PUNC">></span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">content</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newRes</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">lenJ</span><span class="PUNC">=</span><span class="NAME">res.length</span><span class="PUNC">;</span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">lenJ</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">match</span><span class="PUNC">(</span><span class="NAME">regex.key_value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">newRes</span><span class="PUNC">[</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">newRes</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">processFoldedBlock</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">=</span><span class="NAME">block.lines</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">children</span><span class="PUNC">=</span><span class="NAME">block.children</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">=</span><span class="NAME">lines.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">chunks</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="NAME">str</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">children.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">chunks.push</span><span class="PUNC">(</span><span class="NAME">processFoldedBlock</span><span class="PUNC">(</span><span class="NAME">children</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">chunks.join</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">processLiteralBlock</span><span class="PUNC">(</span><span class="NAME">block</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">=</span><span class="NAME">block.lines</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">children</span><span class="PUNC">=</span><span class="NAME">block.children</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">=</span><span class="NAME">lines.join</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">children.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">+</span><span class="PUNC">=</span><span class="NAME">processLiteralBlock</span><span class="PUNC">(</span><span class="NAME">children</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">processBlock</span><span class="PUNC">(</span><span class="NAME">blocks</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">children</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentObj</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">level</span><span class="PUNC">=</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">processedBlocks</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">lenJ</span><span class="PUNC">=</span><span class="NAME">blocks.length</span><span class="PUNC">;</span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">lenJ</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">level</span><span class="PUNC">!=</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">&&</span><span class="NAME">level</span><span class="PUNC">!=</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">level</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="NAME">processedBlocks.push</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">level</span><span class="PUNC">=</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">level</span><span class="PUNC">;</span><span class="NAME">lines</span><span class="PUNC">=</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">lines</span><span class="PUNC">;</span><span class="NAME">children</span><span class="PUNC">=</span><span class="NAME">blocks</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">children</span><span class="PUNC">;</span><span class="NAME">currentObj</span><span class="PUNC">=</span><span class="KEYW">null</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">len</span><span class="PUNC">=</span><span class="NAME">lines.length</span><span class="PUNC">;</span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="NAME">len</span><span class="PUNC">;</span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">=</span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">line.match</span><span class="PUNC">(</span><span class="NAME">regex.key</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">"-"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">key</span><span class="PUNC">=</span><span class="NAME">key.replace</span><span class="PUNC">(</span><span class="NAME">regex.item</span><span class="PUNC">,</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isMap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">res.length</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="NAME">currentObj</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">!=</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="NAME">regex.trim</span><span class="PUNC">,</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">"&"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nb</span><span class="PUNC">=</span><span class="NAME">processBlock</span><span class="PUNC">(</span><span class="NAME">children</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">nb</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">nb</span><span class="PUNC">}</span><span class="NAME">reference_blocks</span><span class="PUNC">[</span><span class="NAME">value.substr</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">nb</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">"|"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processLiteralBlock</span><span class="PUNC">(</span><span class="NAME">children.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processLiteralBlock</span><span class="PUNC">(</span><span class="NAME">children.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">"*"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">=</span><span class="NAME">value.substr</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">no</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">reference_blocks</span><span class="PUNC">[</span><span class="NAME">v</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">errors.push</span><span class="PUNC">(</span><span class="STRN">"Reference '"</span><span class="PUNC">+</span><span class="NAME">v</span><span class="PUNC">+</span><span class="STRN">"' not found!"</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">reference_blocks</span><span class="PUNC">[</span><span class="NAME">v</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">no</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">reference_blocks</span><span class="PUNC">[</span><span class="NAME">v</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">no</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">no</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">==</span><span class="STRN">">"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processFoldedBlock</span><span class="PUNC">(</span><span class="NAME">children.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processFoldedBlock</span><span class="PUNC">(</span><span class="NAME">children.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processBlock</span><span class="PUNC">(</span><span class="NAME">children</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">processBlock</span><span class="PUNC">(</span><span class="NAME">children</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">line.match</span><span class="PUNC">(</span><span class="REGX">/^-\s*$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isMap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">res.length</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="NAME">currentObj</span><span class="PUNC">=</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">true</span><span class="PUNC">;</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">line.match</span><span class="PUNC">(</span><span class="REGX">/^-\s*(.*)/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">currentObj.push</span><span class="PUNC">(</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isMap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">res.length</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">processValue</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">continue</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">!=</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">isMap</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">isMap</span><span class="PUNC">=</span><span class="KEYW">false</span><span class="PUNC">;</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">res.length</span><span class="PUNC">)</span><span class="PUNC">===</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">res</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="NAME">res.push</span><span class="PUNC">(</span><span class="NAME">currentObj</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NAME">processedBlocks.length</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="NAME">j</span><span class="PUNC">>=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="PUNC">--</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">blocks.splice.call</span><span class="PUNC">(</span><span class="NAME">blocks</span><span class="PUNC">,</span><span class="NAME">processedBlocks</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">semanticAnalysis</span><span class="PUNC">(</span><span class="NAME">blocks</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="NAME">processBlock</span><span class="PUNC">(</span><span class="NAME">blocks.children</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">preProcess</span><span class="PUNC">(</span><span class="NAME">src</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">=</span><span class="NAME">src.split</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">=</span><span class="NAME">regex.comment</span><span class="PUNC">;</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">=</span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">match</span><span class="PUNC">(</span><span class="NAME">r</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="PUNC">!==</span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">=</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">-</span><span class="NAME">m</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">lines.join</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">eval</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="NAME">errors</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="NAME">reference_blocks</span><span class="PUNC">=</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="NAME">processing_time</span><span class="PUNC">=</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pre</span><span class="PUNC">=</span><span class="NAME">preProcess</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">doc</span><span class="PUNC">=</span><span class="NAME">parser</span><span class="PUNC">(</span><span class="NAME">pre</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">=</span><span class="NAME">semanticAnalysis</span><span class="PUNC">(</span><span class="NAME">doc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="NAME">processing_time</span><span class="PUNC">=</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">-</span><span class="NAME">processing_time</span><span class="PUNC">;</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">}</span><span class="KEYW">return</span><span class="PUNC">{</span><span class="NAME">fromURL</span><span class="PUNC">:</span><span class="NAME">fromURL</span><span class="PUNC">,</span><span class="NAME">eval</span><span class="PUNC">:</span><span class="NAME">eval</span><span class="PUNC">,</span><span class="NAME">getErrors</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errors</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="NAME">getProcessingTime</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">processing_time</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>